<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
   <title>佐心，教家长做父母</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" href="assets/css/amazeui.min.css">
    <link rel="stylesheet" href="assets/css/style.css?v=2.3">
    <link rel="stylesheet" href="assets/css/index.css?v=2.3">
    <script src="assets/js/myAlert.js"></script>
     <script>
    var counseTel='${tel}';
    var jinttian='${xingqi}';
    var errorMsg='${errorMsg}';
    if(errorMsg=='error'){
    	myAlert("请预约的时间，已被预约，请选择其他时间");
    }
    var bookDay=jinttian;
    var bookTime="";
         var type="0";
     var server_id="";
    </script>
<script>
    	    /** 
     * 返回前一页（或关闭本页面） 
     * <li>如果没有前一页历史，则直接关闭当前页面</li> 
     */  
    function goBack(){  
         location.href="index.jsp";
    }  
    </script>
</head>
<body class="bg-white">
<header data-am-widget="header" class="am-header am-header-default am-header-fixed am-border-bottom">
    <div class="am-header-left am-header-nav">
        <a  onclick="goBack();"  >
            <i class="icon_8"></i>
        </a>
    </div>
    <h1 class="am-header-title">
        预约
    </h1>

</header>

<section class="am-padding-bottom-sm" id="amz-main" data-tag="css-nav">

    <!--咨询师-->
    <div class="am-g  am-padding-top-sm ">
        <div class=" am-u-sm-12 am-list-main box am-padding-left-sm">
            <div class="width-60px">
                <a class="">
                    <img id="personHead" class="img-50" src="assets/images/upload/pic.png"/>
                </a>
            </div>
            <div class="box-1">
                <div id="cName" class="am-list-item-hd font-color-13 margin-top-2px">
                    李星星
                </div>

                <div class="agm-g font-color-13 font-12">
                    <div class="am-u-sm-6 dian2 am-padding-left-sm" id="service15Price"></div>
                    <div class="am-u-sm-6 dian2" id="service40Price"></div>
                </div>
            </div>
        </div>
    </div>

    <!-- 培训方式-->
    <div class="icon_26 am-text-center font-color-12 margin-top-15 ">
        预约方式
    </div>
    <div class="am-padding-left-sm am-padding-top-sm am-padding-right-sm " id="advisorytype">
        <ul class="am-pagination am-pagination-default counsList">
        </ul>
    </div>

    <!-- 可约时间-->
    <div class="icon_26 am-text-center font-color-12 margin-top-15 ">
        可约时间
    </div>

    <c:if test="${xingqi==1}">
	  <div id="wrapper" class="link-list am-margin-top-sm">
        <div id="scroller" class="select-day">
            <ul id="thelist">
            	<li class="current" onclick="window.location.href='gotoyuyuejsp?tel=${tel}${1}'"><div>周一</div> <div class="font-12">${d1}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${2}'"><div>周二</div><div class="font-12">${d2}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${3}'"><div>周三</div><div class="font-12">${d3}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${4}'"><div>周四</div><div class="font-12">${d4}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${5}'"><div>周五</div><div class="font-12">${d5}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${6}'"><div>周六</div><div class="font-12">${d6}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${7}'"><div>周日</div><div class="font-12">${d7}</div></li>
                 
            </ul>
        </div>
    </div>
	</c:if>
	<c:if test="${xingqi==2}">
	  <div id="wrapper" class="link-list am-margin-top-sm">
        <div id="scroller" class="select-day">
            <ul id="thelist">
                 <li class="current" onclick="window.location.href='gotoyuyuejsp?tel=${tel}${2}</div>'">
                 <div>周二</div>
                 <div class="font-12">${d1}</div>
                 </li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${3}'"><div>周三</div><div class="font-12">${d2}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${4}'"><div>周四</div><div class="font-12">${d3}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${5}'"><div>周五</div><div class="font-12">${d4}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${6}'"><div>周六</div><div class="font-12">${d5}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${7}'"><div>周日</div><div class="font-12">${d6}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${1}'"><div>周一</div><div class="font-12">${d7}</div></li>
            </ul>
        </div>
    </div>
	</c:if>
	<c:if test="${xingqi==3}">
	  <div id="wrapper" class="link-list am-margin-top-sm">
        <div id="scroller" class="select-day">
            <ul id="thelist">
                 <li class="current" onclick="window.location.href='gotoyuyuejsp?tel=${tel}${3}'"><div>周三</div><div class="font-12">${d1}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${4}'"><div>周四</div><div class="font-12">${d2}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${5}'"><div>周五</div><div class="font-12">${d3}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${6}'"><div>周六</div><div class="font-12">${d4}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${7}'"><div>周日</div><div class="font-12">${d5}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${1}'"><div>周一</div><div class="font-12">${d6}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${2}'"><div>周二</div><div class="font-12">${d7}</div></li>
            </ul>
        </div>
    </div>
	</c:if>
	<c:if test="${xingqi==4}">
	  <div id="wrapper" class="link-list am-margin-top-sm">
        <div id="scroller" class="select-day">
            <ul id="thelist">
                 <li  class="current" onclick="window.location.href='gotoyuyuejsp?tel=${tel}${4}'"><div>周四</div><div class="font-12">${d1}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${5}'"><div>周五</div><div class="font-12">${d2}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${6}'"><div>周六</div><div class="font-12">${d3}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${7}'"><div>周日</div><div class="font-12">${d4}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${1}'"><div>周一</div><div class="font-12">${d5}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${2}'"><div>周二</div><div class="font-12">${d6}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${3}'"><div>周三</div><div class="font-12">${d7}</div></li>
            </ul>
        </div>
    </div>
	</c:if>
	<c:if test="${xingqi==5}">
	  <div id="wrapper" class="link-list am-margin-top-sm">
        <div id="scroller" class="select-day">
            <ul id="thelist">
                <li class="current" onclick="window.location.href='gotoyuyuejsp?tel=${tel}${5}'"><div>周五</div><div class="font-12">${d1}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}</div>${6}'"><div>周六<div class="font-12">${d2}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}</div>${7}'"><div>周日<div class="font-12">${d3}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}</div>${1}'"><div>周一<div class="font-12">${d4}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}</div>${2}'"><div>周二<div class="font-12">${d5}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}</div>${3}'"><div>周三<div class="font-12">${d6}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}</div>${4}'"><div>周四<div class="font-12">${d7}</div></li>
            </ul>
        </div>
    </div>
	</c:if>
	<c:if test="${xingqi==6}">
	  <div id="wrapper" class="link-list am-margin-top-sm">
        <div id="scroller" class="select-day">
            <ul id="thelist">
                 <li  class="current" onclick="window.location.href='gotoyuyuejsp?tel=${tel}${6}'"><div>周六</div><div class="font-12">${d1}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${7}'"><div>周日</div><div class="font-12">${d2}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${1}'"><div>周一</div><div class="font-12">${d3}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${2}'"><div>周二</div><div class="font-12">${d4}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${3}'"><div>周三</div><div class="font-12">${d5}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${4}'"><div>周四</div><div class="font-12">${d6}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${5}'"><div>周五</div><div class="font-12">${d7}</div></li>
            </ul>
        </div>
    </div>
	</c:if>
	<c:if test="${xingqi==7}">
	  <div id="wrapper" class="link-list am-margin-top-sm">
        <div id="scroller" class="select-day">
            <ul id="thelist">
                 <li  class="current" onclick="window.location.href='gotoyuyuejsp?tel=${tel}'"><div>周日</div><div class="font-12">${d1}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${1}'"><div>周一</div><div class="font-12">${d2}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${2}'"><div>周二</div><div class="font-12">${d3}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${3}'"><div>周三</div><div class="font-12">${d4}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${4}'"><div>周四</div><div class="font-12">${d5}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${5}'"><div>周五</div><div class="font-12">${d6}</div></li>
                 <li onclick="window.location.href='gotoyuyuejsp?tel=${tel}${6}'"><div>周六</div><div class="font-12">${d7}</div></li>
            </ul>
        </div>
    </div>
	</c:if>
    <div class="am-g  bg-white    font-14  am-text-center select-times am-margin-top-xs">

        <div class="select-time am-padding-left-sm">
           <c:if test="${c08==08}">
            <div class="am-u-sm-3">
                <div class="btn-time">08:00</div>
            </div>
            </c:if>
            <c:if test="${c08!=08}">
            <div class="am-u-sm-3 dis">
                <div class="btn-time">08:00</div>
            </div>
            </c:if>
             <c:if test="${c09==09}">
            <div class="am-u-sm-3">
                <div class="btn-time">09:00</div>
            </div>
            </c:if>
            <c:if test="${c09!=09}">
            <div class="am-u-sm-3 dis">
                <div class="btn-time">09:00</div>
            </div>
            </c:if>
             <c:if test="${c10==10}">
            <div class="am-u-sm-3">
                <div class="btn-time">10:00</div>
            </div>
            </c:if>
             <c:if test="${c10!=10}">
            <div class="am-u-sm-3 dis">
                <div class="btn-time">10:00</div>
            </div>
            </c:if>
             <c:if test="${c11==11}">
            <div class="am-u-sm-3">
                <div class="btn-time">11:00</div>
            </div>
            </c:if>
             <c:if test="${c11!=11}">
            <div class="am-u-sm-3 dis">
                <div class="btn-time">11:00</div>
            </div>
            </c:if>
             <c:if test="${c12==12}">
            <div class="am-u-sm-3">
                <div class="btn-time">12:00</div>
            </div>
            </c:if>
             <c:if test="${c12!=12}">
            <div class="am-u-sm-3 dis">
                <div class="btn-time">12:00</div>
            </div>
            </c:if>
             <c:if test="${c13==13}">
            <div class="am-u-sm-3">
                <div class="btn-time">13:00</div>
            </div>
            </c:if>
             <c:if test="${c13!=13}">
            <div class="am-u-sm-3 dis">
                <div class="btn-time">13:00</div>
            </div>
            </c:if>
             <c:if test="${c14==14}">
           <div class="am-u-sm-3">
                <div class="btn-time">14:00</div>
            </div>
            </c:if>
             <c:if test="${c14!=14}">
           <div class="am-u-sm-3 dis">
                <div class="btn-time">14:00</div>
            </div>
            </c:if>
             <c:if test="${c15==15}">
            <div class="am-u-sm-3">
                <div class="btn-time">15:00</div>
            </div>
            </c:if>
             <c:if test="${c15!=15}">
            <div class="am-u-sm-3 dis">
                <div class="btn-time">15:00</div>
            </div>
            </c:if>
 			<c:if test="${c16==16}">
            <div class="am-u-sm-3">
                <div class="btn-time">16:00</div>
            </div>
            </c:if>
 			<c:if test="${c16!=16}">
            <div class="am-u-sm-3 dis">
                <div class="btn-time">16:00</div>
            </div>
            </c:if>
             <c:if test="${c17==17}">
           <div class="am-u-sm-3">
                <div class="btn-time">17:00</div>
            </div>
            </c:if>
             <c:if test="${c17!=17}">
           <div class="am-u-sm-3 dis">
                <div class="btn-time">17:00</div>
            </div>
            </c:if>
             <c:if test="${c18==18}">
            <div class="am-u-sm-3">
                <div class="btn-time">18:00</div>
            </div>
            </c:if>
             <c:if test="${c18!=18}">
            <div class="am-u-sm-3 dis">
                <div class="btn-time">18:00</div>
            </div>
            </c:if>
             <c:if test="${c19==19}">
            <div class="am-u-sm-3">
                <div class="btn-time">19:00</div>
            </div>
            </c:if>
             <c:if test="${c19!=19}">
            <div class="am-u-sm-3 dis">
                <div class="btn-time">19:00</div>
            </div>
            </c:if>
 			<c:if test="${c20==20}">
            <div class="am-u-sm-3">
                <div class="btn-time">20:00</div>
            </div>
            </c:if>
 			<c:if test="${c20!=20}">
            <div class="am-u-sm-3 dis">
                <div class="btn-time">20:00</div>
            </div>
            </c:if>
             <c:if test="${c21==21}">
            <div class="am-u-sm-3">
                <div class="btn-time">21:00</div>
            </div>
            </c:if>
             <c:if test="${c21!=21}">
            <div class="am-u-sm-3 dis">
                <div class="btn-time">21:00</div>
            </div>
            </c:if>
            <c:if test="${c22==22}">
            <div class="am-u-sm-3">
                <div class="btn-time">22:00</div>
            </div>
             </c:if>
            <c:if test="${c22!=22}">
            <div class="am-u-sm-3 dis">
                <div class="btn-time">22:00</div>
            </div>
             </c:if>
             <c:if test="${c23==23}">
           <div class="am-u-sm-3">
                <div class="btn-time">23:00</div>
            </div>
             </c:if>
             <c:if test="${c23!=23}">
           <div class="am-u-sm-3 dis">
                <div class="btn-time">23:00</div>
            </div>
             </c:if>
             <c:if test="${c24==24}">
            <div class="am-u-sm-3 am-u-end">
                <div class="btn-time">24:00</div>
            </div>
            </c:if>
             <c:if test="${c24!=24}">
            <div class="am-u-sm-3  dis am-u-end">
                <div class="btn-time">24:00</div>
            </div>
            </c:if>
        </div>
    </div>
</section>

<footer data-am-widget="navbar" class="am-navbar am-cf am-navbar-default bg-white"
        id="">
    <div class="am-g   am-g-collapse am-padding-left-sm">

        <div class="am-u-sm-6 am-padding-right-sm">
            <div class="selectdiv">
                <select class="select-2">
                    <option>请选择咨询时间</option>
                    <option id="fen15">15分钟</option>
                    <option id="fen40">50分钟</option>
                </select>
            </div>
        </div>
        <div class="am-u-sm-6 am-padding-right-sm" id="btnmark">
            <div class="btn-4 padding-left-0" id="uploadVoice" onclick="gotoYuyueOrder()">立即购买</div>
        </div>
    </div>

</footer>


<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/amazeui.min.js"></script>
<script src="assets/js/iscroll.js"></script>
<script>
    //document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
    $(function () {
    
    	var counselorList=$.ajax({url:"myData?counseTel="+counseTel,async:false});
        var jsonCounselor=JSON.parse(counselorList.responseText);
        
        if(jsonCounselor.resultCode=="0"){
        	$("#cName").text(jsonCounselor.counselor.counseName);
        	$("#personHead").attr("src",jsonCounselor.counselor.personHead);
        	if(null!=jsonCounselor.counselor.servicePrice15){
        	$("#service15Price").text("￥"+jsonCounselor.counselor.servicePrice15+"元/15分钟");
        	}else{
        		$("#fen15").remove();
        	}
        	if(null!=jsonCounselor.counselor.servicePrice40){
        	$("#service40Price").text("￥"+jsonCounselor.counselor.servicePrice40+"元/50分钟");
        	}else{
        		$("#fen40").remove();
        	}
        	
        	
        	
        	
        	
        	var counsHtml="";
        	if(null!=jsonCounselor.counselor.counseType){
        		var counseTypes=jsonCounselor.counselor.counseType.split(",");
        		var falg1=0;
        		for(var i=0;i<counseTypes.length;i++){
        			
        			if('${yuyueContype}'==""){
	        			if(counseTypes[i]=="1"){
	        				if(falg1==0){
	        				counsHtml+="<li class='am-active '><a class='border-radius-5'>电话咨询</a></li>";
	        				}else{
	        				counsHtml+="<li class=''><a class='border-radius-5'>电话咨询</a></li>";
	        				}
	        				falg1=1;
	        			}
	        			if(counseTypes[i]=="2"){
	        				if(falg1==0){
	        				counsHtml+="<li class='am-active '><a class='border-radius-5'>面对面咨询</a></li>";
	        				}else{
	        				counsHtml+="<li class=''><a class='border-radius-5'>面对面咨询</a></li>";
	        				}
	        				falg1=1;
	        			}
	        			if(counseTypes[i]=="3"){
	        				if(falg1==0){
	        				counsHtml+="<li class='am-active '><a class='border-radius-5'>视频咨询</a></li>";
	        				}else{
	        				counsHtml+="<li class=''><a class='border-radius-5'>视频咨询</a></li>";
	        				}
	        				falg1=1;
	        			}
        			}else{
        				if(counseTypes[i]=="1"){
        					if('${yuyueContype}'=="1"){
        					counsHtml+="<li class='am-active '><a class='border-radius-5'>电话咨询</a></li>";
        					}else{
        					counsHtml+="<li class=''><a class='border-radius-5'>电话咨询</a></li>";
        					}
	        				
	        			}
	        			if(counseTypes[i]=="2"){
	        				if('${yuyueContype}'=="2"){
	        				counsHtml+="<li class='am-active '><a class='border-radius-5'>面对面咨询</a></li>";
	        				}else{
        					counsHtml+="<li class=''><a class='border-radius-5'>面对面咨询</a></li>";
        					}
	        			}
	        			if(counseTypes[i]=="3"){
	        				if('${yuyueContype}'=="3"){
	        				counsHtml+="<li class='am-active '><a class='border-radius-5'>视频咨询</a></li>";
	        				}else{
        					counsHtml+="<li class=''><a class='border-radius-5'>视频咨询</a></li>";
        					}
	        			}
        			}
        		}
        	}
        	$(".counsList").html(counsHtml);
        }
    
    
        $("#advisorytype li a").on("click", function () {
            $(this).parent().parent().find("li").removeClass("am-active");
            $(this).parent().addClass("am-active");
            var contype=$(".am-active").find(".border-radius-5").text();
            if(contype=="电话咨询"){
            	contype=1;
            }else if(contype=="面对面咨询"){
            	contype=2;
            }else{
            	contype=3;
            }
            var htmlobj=$.ajax({url:"saveConType?contype="+contype,async:false});
        });

        // 语言文本切换
        $("#btntext").on("click", function () {
        	$(".wenxin").hide();
			type="0";
            var $voices = $("#btnvoice").find(".icon_46");
            $("#font_voice").text("语音");
            $voices.removeClass("cur");

            $("#txt_question_content").removeClass("am-hide").focus();

        });

        $("#btnvoice").on("click", function () {
			type="1";
            $("#txt_question_content").addClass("am-hide");

            var $voices = $(this).find(".icon_46");
            if ($voices.hasClass("cur")) {
                $voices.removeClass("cur");
                $("#font_voice").text("点击开始");
            } else {
                $voices.addClass("cur");
                $("#font_voice").text("点击结束");
            }
        });


        // 时间选择
        $(".select-day li").click(function () {
            $(".select-day li").removeClass("current");
            $(this).addClass("current");
            bookDay=$(this).text();
        });
        $(".select-time .am-u-sm-3").click(function () {
            if (!$(this).hasClass("dis")) {
                $(".select-time .am-u-sm-3").removeClass("cur");
                $(this).addClass("cur");
                bookTime=$(this).text();
            }
        });
    });
		
	function gotoYuyueOrder(){
	
		var question="";
			if(type=="1"){
				if(""==server_id){
					myAlert("请输入语音");
					return false;
				}
				question=server_id;
			}else if(type=="0"){
				if(""==$("#txt_question_content").val()){
					myAlert("请输入您要询问的问题");
					return false;
				}
				question=$("#txt_question_content").val();
			}else{
				myAlert("请输入问题或语音");
				return false;
			}
		
			if(bookTime==""){
				myAlert("请选择预约时间");
				return false;
			}
			if($(".select-2").val()=="请选择咨询时间"){
				myAlert("请选择咨询时间");
				return false;
			}
			var buyTime=$(".select-2").val();
			buyTime=buyTime.substr(0,2);
			var question=$("#txt_question_content").val();
			var counseType=$(".am-active").find(".border-radius-5").text();
			
			if(bookDay.indexOf("一")>0){
				bookDay="1";
			}
			if(bookDay.indexOf("二")>0){
				bookDay="2";
			}
			if(bookDay.indexOf("三")>0){
				bookDay="3";
			}
			if(bookDay.indexOf("四")>0){
				bookDay="4";
			}
			if(bookDay.indexOf("五")>0){
				bookDay="5";
			}
			if(bookDay.indexOf("六")>0){
				bookDay="6";
			}
			if(bookDay.indexOf("日")>0){
				bookDay="7";
			}
			location.href="gotoYuyueOrderForBind?type="+type+"&buyTime="+buyTime+"&counseTel="+counseTel+"&question=11&counseType="+counseType+"&bookTime="+bookTime+"&bookDay="+bookDay;	
	}
</script>


<script type="text/javascript">

    var myScroll;
    function loaded() {
        myScroll = new iScroll('wrapper',{
            snap:true,
            vScroll:false,
            hScroll:true,
            hScrollbar:false,
            click:true
        });
    }

    //document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);

    document.addEventListener('DOMContentLoaded', loaded, false);

</script>
</body>
</html>